Optimal. Leaf size=443 \[ \frac{(c+d \tan (e+f x))^3 \left (8 a^2 C d^2-10 a b d (c C-4 B d)+b^2 \left (20 d^2 (A-C)-5 B c d+2 c^2 C\right )\right )}{60 d^3 f}+\frac{\log (\cos (e+f x)) \left (a^2 \left (-\left (2 c d (A-C)+B \left (c^2-d^2\right )\right )\right )+2 a b \left (-A \left (c^2-d^2\right )+2 B c d+c^2 C-C d^2\right )+b^2 \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )\right )}{f}-x \left (a^2 \left (-A \left (c^2-d^2\right )+2 B c d+c^2 C-C d^2\right )+2 a b \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )-b^2 \left (-A \left (c^2-d^2\right )+2 B c d+c^2 C-C d^2\right )\right )+\frac{\left (a^2 B+2 a b (A-C)-b^2 B\right ) (c+d \tan (e+f x))^2}{2 f}+\frac{d \tan (e+f x) \left (a^2 (d (A-C)+B c)+2 a b (A c-B d-c C)-b^2 (d (A-C)+B c)\right )}{f}-\frac{b \tan (e+f x) (-2 a C d-5 b B d+2 b c C) (c+d \tan (e+f x))^3}{20 d^2 f}+\frac{C (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^3}{5 d f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 1.27812, antiderivative size = 443, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 45, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.133, Rules used = {3647, 3637, 3630, 3528, 3525, 3475} \[ \frac{(c+d \tan (e+f x))^3 \left (8 a^2 C d^2-10 a b d (c C-4 B d)+b^2 \left (20 d^2 (A-C)-5 B c d+2 c^2 C\right )\right )}{60 d^3 f}+\frac{\log (\cos (e+f x)) \left (a^2 \left (-\left (2 c d (A-C)+B \left (c^2-d^2\right )\right )\right )+2 a b \left (-A \left (c^2-d^2\right )+2 B c d+c^2 C-C d^2\right )+b^2 \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )\right )}{f}-x \left (a^2 \left (-A \left (c^2-d^2\right )+2 B c d+c^2 C-C d^2\right )+2 a b \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )-b^2 \left (-A \left (c^2-d^2\right )+2 B c d+c^2 C-C d^2\right )\right )+\frac{\left (a^2 B+2 a b (A-C)-b^2 B\right ) (c+d \tan (e+f x))^2}{2 f}+\frac{d \tan (e+f x) \left (a^2 (d (A-C)+B c)+2 a b (A c-B d-c C)-b^2 (d (A-C)+B c)\right )}{f}-\frac{b \tan (e+f x) (-2 a C d-5 b B d+2 b c C) (c+d \tan (e+f x))^3}{20 d^2 f}+\frac{C (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^3}{5 d f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3647
Rule 3637
Rule 3630
Rule 3528
Rule 3525
Rule 3475
Rubi steps
\begin{align*} \int (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx &=\frac{C (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^3}{5 d f}+\frac{\int (a+b \tan (e+f x)) (c+d \tan (e+f x))^2 \left (-2 b c C+a (5 A-3 C) d+5 (A b+a B-b C) d \tan (e+f x)-(2 b c C-5 b B d-2 a C d) \tan ^2(e+f x)\right ) \, dx}{5 d}\\ &=-\frac{b (2 b c C-5 b B d-2 a C d) \tan (e+f x) (c+d \tan (e+f x))^3}{20 d^2 f}+\frac{C (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^3}{5 d f}-\frac{\int (c+d \tan (e+f x))^2 \left (10 a b c C d-4 a^2 (5 A-3 C) d^2-b^2 c (2 c C-5 B d)-20 \left (a^2 B-b^2 B+2 a b (A-C)\right ) d^2 \tan (e+f x)-\left (8 a^2 C d^2-10 a b d (c C-4 B d)+b^2 \left (2 c^2 C-5 B c d+20 (A-C) d^2\right )\right ) \tan ^2(e+f x)\right ) \, dx}{20 d^2}\\ &=\frac{\left (8 a^2 C d^2-10 a b d (c C-4 B d)+b^2 \left (2 c^2 C-5 B c d+20 (A-C) d^2\right )\right ) (c+d \tan (e+f x))^3}{60 d^3 f}-\frac{b (2 b c C-5 b B d-2 a C d) \tan (e+f x) (c+d \tan (e+f x))^3}{20 d^2 f}+\frac{C (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^3}{5 d f}-\frac{\int (c+d \tan (e+f x))^2 \left (20 \left (2 a b B-a^2 (A-C)+b^2 (A-C)\right ) d^2-20 \left (a^2 B-b^2 B+2 a b (A-C)\right ) d^2 \tan (e+f x)\right ) \, dx}{20 d^2}\\ &=\frac{\left (a^2 B-b^2 B+2 a b (A-C)\right ) (c+d \tan (e+f x))^2}{2 f}+\frac{\left (8 a^2 C d^2-10 a b d (c C-4 B d)+b^2 \left (2 c^2 C-5 B c d+20 (A-C) d^2\right )\right ) (c+d \tan (e+f x))^3}{60 d^3 f}-\frac{b (2 b c C-5 b B d-2 a C d) \tan (e+f x) (c+d \tan (e+f x))^3}{20 d^2 f}+\frac{C (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^3}{5 d f}-\frac{\int (c+d \tan (e+f x)) \left (-20 d^2 \left (a^2 (A c-c C-B d)-b^2 (A c-c C-B d)-2 a b (B c+(A-C) d)\right )-20 d^2 \left (2 a b (A c-c C-B d)+a^2 (B c+(A-C) d)-b^2 (B c+(A-C) d)\right ) \tan (e+f x)\right ) \, dx}{20 d^2}\\ &=-\left (a^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )+2 a b \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) x+\frac{d \left (2 a b (A c-c C-B d)+a^2 (B c+(A-C) d)-b^2 (B c+(A-C) d)\right ) \tan (e+f x)}{f}+\frac{\left (a^2 B-b^2 B+2 a b (A-C)\right ) (c+d \tan (e+f x))^2}{2 f}+\frac{\left (8 a^2 C d^2-10 a b d (c C-4 B d)+b^2 \left (2 c^2 C-5 B c d+20 (A-C) d^2\right )\right ) (c+d \tan (e+f x))^3}{60 d^3 f}-\frac{b (2 b c C-5 b B d-2 a C d) \tan (e+f x) (c+d \tan (e+f x))^3}{20 d^2 f}+\frac{C (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^3}{5 d f}-\left (2 a b \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-a^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )+b^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \int \tan (e+f x) \, dx\\ &=-\left (a^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )+2 a b \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) x+\frac{\left (2 a b \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-a^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )+b^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \log (\cos (e+f x))}{f}+\frac{d \left (2 a b (A c-c C-B d)+a^2 (B c+(A-C) d)-b^2 (B c+(A-C) d)\right ) \tan (e+f x)}{f}+\frac{\left (a^2 B-b^2 B+2 a b (A-C)\right ) (c+d \tan (e+f x))^2}{2 f}+\frac{\left (8 a^2 C d^2-10 a b d (c C-4 B d)+b^2 \left (2 c^2 C-5 B c d+20 (A-C) d^2\right )\right ) (c+d \tan (e+f x))^3}{60 d^3 f}-\frac{b (2 b c C-5 b B d-2 a C d) \tan (e+f x) (c+d \tan (e+f x))^3}{20 d^2 f}+\frac{C (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^3}{5 d f}\\ \end{align*}
Mathematica [C] time = 6.5013, size = 383, normalized size = 0.86 \[ \frac{C (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^3}{5 d f}+\frac{\frac{b \tan (e+f x) (2 a C d+5 b B d-2 b c C) (c+d \tan (e+f x))^3}{4 d f}-\frac{\frac{(c+d \tan (e+f x))^3 \left (-8 a^2 C d^2+10 a b d (c C-4 B d)+b^2 \left (-\left (20 d^2 (A-C)-5 B c d+2 c^2 C\right )\right )\right )}{3 d f}-\frac{10 \left (d \left (a^2 B+2 a b (A-C)-b^2 B\right ) \left (6 c d^2 \tan (e+f x)+(-d+i c)^3 \log (-\tan (e+f x)+i)-(d+i c)^3 \log (\tan (e+f x)+i)+d^3 \tan ^2(e+f x)\right )+d \left (a^2 (B c-d (A-C))+2 a b (A c+B d-c C)-b^2 (B c-d (A-C))\right ) \left (-i (c-i d)^2 \log (\tan (e+f x)+i)+i (c+i d)^2 \log (-\tan (e+f x)+i)-2 d^2 \tan (e+f x)\right )\right )}{f}}{4 d}}{5 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.017, size = 1165, normalized size = 2.6 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.48102, size = 625, normalized size = 1.41 \begin{align*} \frac{12 \, C b^{2} d^{2} \tan \left (f x + e\right )^{5} + 15 \,{\left (2 \, C b^{2} c d +{\left (2 \, C a b + B b^{2}\right )} d^{2}\right )} \tan \left (f x + e\right )^{4} + 20 \,{\left (C b^{2} c^{2} + 2 \,{\left (2 \, C a b + B b^{2}\right )} c d +{\left (C a^{2} + 2 \, B a b +{\left (A - C\right )} b^{2}\right )} d^{2}\right )} \tan \left (f x + e\right )^{3} + 30 \,{\left ({\left (2 \, C a b + B b^{2}\right )} c^{2} + 2 \,{\left (C a^{2} + 2 \, B a b +{\left (A - C\right )} b^{2}\right )} c d +{\left (B a^{2} + 2 \,{\left (A - C\right )} a b - B b^{2}\right )} d^{2}\right )} \tan \left (f x + e\right )^{2} + 60 \,{\left ({\left ({\left (A - C\right )} a^{2} - 2 \, B a b -{\left (A - C\right )} b^{2}\right )} c^{2} - 2 \,{\left (B a^{2} + 2 \,{\left (A - C\right )} a b - B b^{2}\right )} c d -{\left ({\left (A - C\right )} a^{2} - 2 \, B a b -{\left (A - C\right )} b^{2}\right )} d^{2}\right )}{\left (f x + e\right )} + 30 \,{\left ({\left (B a^{2} + 2 \,{\left (A - C\right )} a b - B b^{2}\right )} c^{2} + 2 \,{\left ({\left (A - C\right )} a^{2} - 2 \, B a b -{\left (A - C\right )} b^{2}\right )} c d -{\left (B a^{2} + 2 \,{\left (A - C\right )} a b - B b^{2}\right )} d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 60 \,{\left ({\left (C a^{2} + 2 \, B a b +{\left (A - C\right )} b^{2}\right )} c^{2} + 2 \,{\left (B a^{2} + 2 \,{\left (A - C\right )} a b - B b^{2}\right )} c d +{\left ({\left (A - C\right )} a^{2} - 2 \, B a b -{\left (A - C\right )} b^{2}\right )} d^{2}\right )} \tan \left (f x + e\right )}{60 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.22046, size = 1007, normalized size = 2.27 \begin{align*} \frac{12 \, C b^{2} d^{2} \tan \left (f x + e\right )^{5} + 15 \,{\left (2 \, C b^{2} c d +{\left (2 \, C a b + B b^{2}\right )} d^{2}\right )} \tan \left (f x + e\right )^{4} + 20 \,{\left (C b^{2} c^{2} + 2 \,{\left (2 \, C a b + B b^{2}\right )} c d +{\left (C a^{2} + 2 \, B a b +{\left (A - C\right )} b^{2}\right )} d^{2}\right )} \tan \left (f x + e\right )^{3} + 60 \,{\left ({\left ({\left (A - C\right )} a^{2} - 2 \, B a b -{\left (A - C\right )} b^{2}\right )} c^{2} - 2 \,{\left (B a^{2} + 2 \,{\left (A - C\right )} a b - B b^{2}\right )} c d -{\left ({\left (A - C\right )} a^{2} - 2 \, B a b -{\left (A - C\right )} b^{2}\right )} d^{2}\right )} f x + 30 \,{\left ({\left (2 \, C a b + B b^{2}\right )} c^{2} + 2 \,{\left (C a^{2} + 2 \, B a b +{\left (A - C\right )} b^{2}\right )} c d +{\left (B a^{2} + 2 \,{\left (A - C\right )} a b - B b^{2}\right )} d^{2}\right )} \tan \left (f x + e\right )^{2} - 30 \,{\left ({\left (B a^{2} + 2 \,{\left (A - C\right )} a b - B b^{2}\right )} c^{2} + 2 \,{\left ({\left (A - C\right )} a^{2} - 2 \, B a b -{\left (A - C\right )} b^{2}\right )} c d -{\left (B a^{2} + 2 \,{\left (A - C\right )} a b - B b^{2}\right )} d^{2}\right )} \log \left (\frac{1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 60 \,{\left ({\left (C a^{2} + 2 \, B a b +{\left (A - C\right )} b^{2}\right )} c^{2} + 2 \,{\left (B a^{2} + 2 \,{\left (A - C\right )} a b - B b^{2}\right )} c d +{\left ({\left (A - C\right )} a^{2} - 2 \, B a b -{\left (A - C\right )} b^{2}\right )} d^{2}\right )} \tan \left (f x + e\right )}{60 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 4.66021, size = 1134, normalized size = 2.56 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]